import ThemeContext from "./context/theme-context"

const UserAvatar = (() => {
  return (
    <div>
      <span>UserAvatar</span>
      {/* 函数式组件中使用Context共享的数据方式 */}
      <ThemeContext.Consumer>
        {
          value => {
            return <p>{ value.name } - { value.age }</p>
          }
        }
      </ThemeContext.Consumer>
    </div>
  )
})

export default UserAvatar